home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 2000 July: Mac OS SDK / Dev.CD Jul 00 SDK2.toast / Development Kits / Hardware / Mac OS USB DDK / Mac OS USB DDK 1.4.1 / Examples / USBTabletModule / USBTabletModule.h < prev    next >
Encoding:
C/C++ Source or Header  |  2000-04-25  |  2.7 KB  |  107 lines  |  [TEXT/CWIE]

  1. /*
  2.     File:        USBTabletModule.h
  3.  
  4.     Contains:    Header file for Wacom module
  5.  
  6.     Version:    xxx put version here xxx
  7.  
  8.     Copyright:    © 1997-1998 by Apple Computer, Inc., all rights reserved.
  9.  
  10. */
  11. #ifndef __WacomModuleH__
  12. #define __WacomModuleH__
  13.  
  14. #include <Types.h>
  15. #include <Devices.h>
  16. #include <DriverServices.h>
  17. #include <Processes.h>
  18. #include <CursorDevices.h>
  19. #include <USB.h>
  20.  
  21. OSStatus     WacomDriverValidateHW(USBDeviceRef device, USBDeviceDescriptor *desc);
  22. OSStatus    WacomDeviceInitialize(USBDeviceRef device, USBDeviceDescriptorPtr pDesc, UInt32 busPowerAvailable);
  23. OSStatus    WacomInterfaceInitialize(UInt32 interfacenum, USBInterfaceDescriptorPtr pInterface, USBDeviceDescriptorPtr pDesc, USBDeviceRef device);
  24. OSStatus    WacomDriverFinalize(USBDeviceRef theDeviceRef, USBDeviceDescriptorPtr pDesc);
  25. OSStatus    WacomDriverNotifyProc(UInt32  notification, void *pointer, UInt32 refCon);
  26.  
  27. OSStatus     API_InstallInterrupt(HIDInterruptProcPtr HIDInterruptFunction, UInt32 refcon);
  28. OSStatus     API_PollDevice(void);
  29. OSStatus     API_GetDeviceInfo(UInt32 theInfoSelector, void * theInfo);
  30. OSStatus     API_EnterPolledMode(void);
  31. OSStatus     API_ExitPolledMode(void);
  32. OSStatus     API_ControlDevice(UInt32 theControlSelector, void * theControlData);
  33.  
  34.  
  35. Boolean        immediateError(OSStatus err);
  36.  
  37. void         InitiateTransactionProc(USBPB *pb);
  38. void         TransactionCompletionProc(USBPB *pb);
  39.  
  40. void         DeviceInitialize(USBDeviceRef device, USBDeviceDescriptorPtr pDeviceDescriptor, UInt32 busPowerAvailable);
  41. void         ProcessInterruptReport(UInt32 devicetype, UInt8 hidReport[]);
  42.  
  43. void         NotifyCursorDeviceManager(UInt32 refcon, void * theData);
  44. void         InitParamBlock(USBDeviceRef theDeviceRef, USBPB * paramblock);
  45.  
  46. #define kWacomRetryCount    3
  47.  
  48. enum driverstages
  49. {
  50.     kUndefined = 0,
  51.     kFindInterface,
  52.     kOpenDevice,
  53.     kNewInterfaceRef,
  54.     kConfigureInterface,
  55.     kSetProtocol,
  56.     kGetReportDescriptor,
  57.     kFindInterruptPipe,
  58.     kReadInterruptPipe,
  59.     kReturnFromDriver =     0x1000,
  60.     kRetryTransaction =     0x2000,
  61.     kSyncTransaction =         0x4000,
  62.     kCompletionPending =     0x8000
  63. };
  64.  
  65.  
  66. typedef struct
  67. {
  68.     UInt8    spare;
  69.     UInt16    xPosition;
  70.     UInt16    yPosition;
  71.     UInt8    buttons;
  72.     UInt8    pressure;
  73.  
  74. } WacomReport;
  75.  
  76. typedef struct
  77. {
  78.     USBPB                             pb;
  79.     void (*handler)(USBPB             *pb);
  80.  
  81.     UInt32                            refcon;
  82.     
  83.     UInt32                            interfaceNumber;
  84.     UInt32                            configurationNumber;
  85.     
  86.     USBDeviceRef                    deviceRef;
  87.     USBInterfaceRef                    interfaceRef;
  88.     USBPipeRef                        pipeRef;
  89.  
  90.     UInt32                            hidReportSize;
  91.     UInt8                            hidReport[255];
  92.     UInt8                            hidReportDescriptor[255];
  93.     
  94.     HIDInterruptProcPtr             pSHIMInterruptRoutine;
  95.     HIDInterruptProcPtr             pSavedInterruptRoutine;
  96.     
  97.     SInt32                             retryCount;
  98.     SInt32                            transDepth;
  99.     
  100.     CursorDevicePtr                    pCursorDeviceInfo;
  101.     CursorDevice                    cursorDeviceInfo;
  102.     Fixed                            unitsPerInch;
  103.     UInt32                            busPowerAvailable;
  104.     
  105. } usbWacomPBStruct;
  106.  
  107. #endif //__WacomModuleH__